<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<title>添加消息分发</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" th:href="@{/static/plugin/layui/css/layui.css}" media="all" />
	<link rel="stylesheet" th:href="@{/static/plugin/layui/css/font_eolqem241z66flxr.css}" media="all" />
</head>
<body class="childrenBody">
	<form class="layui-form" id="iotdispatch" style="width:80%;">
		<input type="hidden" name="id" th:value="${iotdispatch?.id}" >
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">消息来源</label>
				<div class="layui-input-block">
					<!--<input type="text" class="layui-input" name="port"
						   th:value="${iotdispatch?.deviceName}" placeholder="请输入设备名称">-->
					<select class="layui-select" name="port" id="port" lay-verify="required" >
						<option value="">请选择消息来源</option>
						<option th:if="${configs ne null}" th:each="item:${configs}"
						  th:value="${item?.port}" th:text="${item?.deviceName}"
								th:selected="${iotdispatch?.port eq item?.port}">
						</option>
					</select>
				</div>
		  </div>
			<div class="layui-inline">
				<label class="layui-form-label">分发目标ip</label>
				<div class="layui-input-block">
					<input type="text" name="address" class="layui-input" th:value="${iotdispatch?.address}"
						    placeholder="请输入端口">
				</div>
			</div>
			<div  class="layui-inline">
				<div class="layui-form-item">
					<label class="layui-form-label">目标ip端口</label>
					<div class="layui-input-block">
						<input type="text"  class="layui-input" name="mqport"
							   th:value="${iotdispatch?.mqport}">
					</div>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">虚拟主机</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input" name="virtualHost"
						   th:value="${iotdispatch?.virtualHost}">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">交换器名称</label>
				<div class="layui-input-inline">
					<input type="text"  class="layui-input" name="exchange"
						   th:value="${iotdispatch?.exchange}">
				</div>
			</div>
			<div  class="layui-inline">
				<label class="layui-form-label">交换器类型</label>
				<div class="layui-input-block">
					<!--<input type="text"  class="layui-input" name="exchangeType"
						   th:value="${iotdispatch?.queueLength}">-->
					<select class="layui-select" name="exchangeType" id="exchangeType">
						<option value="">请选择交换器类型</option>
						<option th:selected="${iotdispatch?.exchangeType eq 'direct'}"
								value="direct">直连交换机-Direct exchange</option>
						<option th:selected="${iotdispatch?.exchangeType eq 'fanout'}"
						value="fanout">扇形交换机-Fanout exchange</option>
						<option th:selected="${iotdispatch?.exchangeType eq 'topic'}"
								value="topic">主题交换机-Topic exchange</option>
						<option th:selected="${iotdispatch?.exchangeType eq 'headers'}"
								value="headers">首部交换机-Headers exchange</option>
					</select>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">消息匹配规则</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input" name="routingKey"
						   th:value="${iotdispatch?.routingKey}">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">消息分发队列</label>
				<div class="layui-input-inline">
					<input type="text"  class="layui-input" name="queueName"
						   th:value="${iotdispatch?.queueName}">
				</div>
			</div>
			<div  class="layui-inline">
				<label class="layui-form-label">消息发布确认</label>
				<div class="layui-input-block">
					<!--<input type="text"  class="layui-input" name="publisherConfirm"
						   th:value="${iotdispatch?.queueLength}">-->
					<input type="radio" th:checked="${iotdispatch?.publisherConfirm eq '0'}"
						   name="publisherConfirm" value="0" title="否">
					<input type="radio" th:checked="${iotdispatch?.publisherConfirm eq '1'}"
						   name="publisherConfirm" value="1" title="是">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">用户名</label>
				<div class="layui-input-block">
					<input type="text" class="layui-input" name="username"
						   th:value="${iotdispatch?.username}">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">密码</label>
				<div class="layui-input-inline">
					<input type="text"  class="layui-input" name="password"
						   th:value="${iotdispatch?.password}">
				</div>
			</div>
			<div  class="layui-inline">
				<label class="layui-form-label">是否启用</label>
				<div class="layui-input-block">
				<!--	<input type="text"  class="layui-input" name="isOpen"
						   th:value="${iotdispatch?.isOpen}">-->
					<input type="radio" th:checked="${iotdispatch?.isOpen eq '0'}"
						   name="isOpen" value="0" title="禁用">
					<input type="radio" th:checked="${iotdispatch?.isOpen eq '1'}"
						   name="isOpen" value="1" title="启用">
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn icon-position-button" th:if="${iotdispatch eq null}"  lay-submit  lay-filter="save"> 保存</button>
				<button class="layui-btn icon-position-button" th:if="${iotdispatch ne null}"  lay-submit  lay-filter="edit"> 修改</button>
				<!--<input class="layui-btn" type="reset" value="重置">-->
				<button class="layui-btn  icon-position-button" id="reset" type="reset" lay-event="reset">
					重置
				</button>
		    </div>
		</div>
	</form>
	<script type="text/javascript" th:src="@{/static/plugin/layui/layui.js}"></script>
	<script type="text/javascript" th:src="@{/static/js/iot/dispatch_add.js}"></script>
</body>
</html>